import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { LayoutComponent } from './layout/layout.component';
import { DengluComponent } from './denglu/denglu.component';
import { LoginComponent } from './denglu/login/login.component';

// 配置路由
const routes: Routes = [
  {
    path: '',
    component: LayoutComponent,
    children: [
      {
        path: '',
        // redirectTo: '/overview',
        redirectTo: '/system/setting/dynamic',
        pathMatch: 'full'
      },
      {
        path: 'overview',
        loadChildren: './features/overview/overview.module#OverviewModule'
      },
      {
        path: 'system',
        loadChildren: './features/system/system.module#SystemModule'
      }
    ]
  },
  {
    path: '**',
    redirectTo: '/system/setting/dynamic'
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
